<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>查看我的项目</title>
	<%@ include file="/WEB-INF/include/include.jsp" %>
	<script type="text/javascript" src="<%=path %>/js/rms/myres/myResEdit.js"></script>
  </head>
  <body>
	<div class="editpage-locked-content">
		<h2 class="editpage-lk-title" >查看我的项目:<script type="text/javascript">document.write(MyResEdit.objName)</script></h2>		
		<div class="editpage-lk-tbar" id="tbarWrap"></div>
	</div>
	<div class="editpage-content" >
		<div class="editpage-form" id="formWrap"></div>
		<div id="hostGridWrap"></div>
		<div id="resCheckFormWrap"></div>
		<div id="auditFormWrap"></div>
		<div id="auditLogGridWrap"></div>
	</div>
  </body>
</html>

	<ui:page>
	
	<ui:toolbar  id="toolbar"  renderTo="tbarWrap" >
		<x:items>		
			<ui:button text="取消" iconCls='icon-cancel' handler="MyResEdit.close" scope="MyResEdit" />
			<x:value>-</x:value>
		</x:items>
	</ui:toolbar>

	<ui:formPanel id="myResForm" width="600" renderTo="formWrap">
		<x:attr name="border" type="int" >0</x:attr>
		<x:attr name="bodyPadding"  type="int" >5</x:attr>
		<x:attr name="fieldDefaults">
			<x:value>
				<x:attr name="labelAlign"  type="string" >right</x:attr>
			</x:value>
		</x:attr>
		<x:items>
			<x:value>
				<x:attr name="padding" type="string">2</x:attr>
				<x:attr name="layout">column</x:attr>
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="items" type="array">
					<ui:formPanel.text  id="resName" fieldLabel="项目名称" allowBlank="false" readOnly="true" width="510" config="true"   />
				</x:attr>
			</x:value>	
			<x:value>
				<x:attr name="padding" type="string">2</x:attr>
				<x:attr name="layout">column</x:attr>
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="items" type="array">
					<ui:formPanel.text  id="eName" fieldLabel="英文名称" allowBlank="false" readOnly="true" config="true"   />
				</x:attr>
			</x:value>	
			<x:value>
				<x:attr name="padding" type="string">2</x:attr>
				<x:attr name="layout">column</x:attr>
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="items" type="array">
					<ui:formPanel.date id="startDate"  fieldLabel="开始时间" allowBlank="false" readOnly="true" config="true" ></ui:formPanel.date>
					<ui:formPanel.date id="endDate" fieldLabel="结束时间" allowBlank="false" readOnly="true" config="true" ></ui:formPanel.date>
				</x:attr>
			</x:value>					
			<x:value>
				<x:attr name="padding" type="string">2</x:attr>
				<x:attr name="layout">column</x:attr>
				<x:attr name="border" type="int" >0</x:attr>
				<x:attr name="items" type="array">
					<ui:formPanel.textarea id="resDesc" fieldLabel="项目描述" readOnly="true" config="true" width="510"  />		
					<ui:formPanel.hidden id="applyId" config="true" />
					<ui:formPanel.hidden id="authorId" config="true" />
				</x:attr>
			</x:value>
		</x:items>
	</ui:formPanel>

  	<ui:model name="MyResHostModel">
  		 <x:attr name="fields" type="array">
  			<ui:model.field name="hostId"   ></ui:model.field>
  			<ui:model.field name="resId"   ></ui:model.field>
  			<ui:model.field name="hostName"   ></ui:model.field>
  			<ui:model.field name="hostIp"   ></ui:model.field>
  			<ui:model.field name="account"   ></ui:model.field>
  			<ui:model.field name="pwd"   ></ui:model.field>
  			<ui:model.field name="hostDesc"   ></ui:model.field>
  			<ui:model.field name="opsSeries"   ></ui:model.field>
  			<ui:model.field name="opsName"   ></ui:model.field>
  			<ui:model.field name="cups"   ></ui:model.field>
  			<ui:model.field name="memory"   ></ui:model.field>
  			<ui:model.field name="memoryunit"   ></ui:model.field>
  			<ui:model.field name="storage"   ></ui:model.field>
  			<ui:model.field name="storageunit"   ></ui:model.field>
  			<ui:model.field name="netcards"   ></ui:model.field>
  		</x:attr>
  	</ui:model>
	
	
	<ui:grid id="hostConfigGrid" model="MyResHostModel" 
		datasetName="MyResDataSetHandler" showCheckbox="true" showPaging="false"
		handlerName="MyResQueryHandler" handlerMethod="queryGrid" autoLoad="false" title="主机列表"
		renderTo="hostGridWrap"	>
		<x:columns>
			<ui:gridcolumn dataIndex="hostName"  text="主机名" ></ui:gridcolumn>	
			<ui:gridcolumn dataIndex="hostIp"  text="主机IP" ></ui:gridcolumn>	
			<ui:gridcolumn dataIndex="account"  text="登录帐号" ></ui:gridcolumn>	
			<ui:gridcolumn dataIndex="pwd"  text="登录密码" ></ui:gridcolumn>	
			<ui:gridcolumn dataIndex="opsName"  text="操作系统" renderer="MyResEdit.renderGrid"></ui:gridcolumn>
			<ui:gridcolumn dataIndex="cups" text="CPU个数"  ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="memory" text="内存大小"  renderer="MyResEdit.renderGrid"></ui:gridcolumn>
			<ui:gridcolumn dataIndex="storage"  text="硬盘大小" renderer="MyResEdit.renderGrid"></ui:gridcolumn>
			<ui:gridcolumn dataIndex="netcards"  text="网卡个数" ></ui:gridcolumn>
			<ui:gridcolumn dataIndex="hostDesc"  text="描述" ></ui:gridcolumn>
            <ui:gridcolumn dataIndex="hostName" renderer="OpenConsole" text="登录" />
		</x:columns>
		
	</ui:grid>
	
	 
	
	<x:bottomScript>
		MyResEdit.loadForm();
        function OpenConsole(v,c,r) {
          var hostName=r.get('hostName');
          return "<a href='#' onclick=javascript:window.open('../vmrc/vm-console.jsp?org=test&vdc=test&app="+Ext.getCmp('eName').getValue()+"&vm="+hostName+"') >登录</a>";
        }
	</x:bottomScript>
	
	</ui:page>

	
